package com.opennetexam.manager.sqlprovider;

import org.apache.log4j.Logger;

import java.util.HashMap;
import java.util.Map;

/**
 * @author naicha
 * Created on 2017/11/15.
 */
public class ExamPaperProvider {

    private static Logger logger = Logger.getLogger(ExamPaperProvider.class);

    public String getExamPapersBySomeWhere(Map<String,Object> parameter){
        StringBuilder stringBuffer = new StringBuilder();
        String appID = (String) parameter.get("appID");
        String examPlanInfoID = (String) parameter.get("examPlanInfoID");
        String examSubjectID = (String) parameter.get("examSubjectID");

        stringBuffer.append("SELECT * FROM ExamPaper WHERE ExamPlanInfoID = \'").append(examPlanInfoID).append("\' AND ExamSubjectID = \'").append(examSubjectID).append("\' AND AppID = \'").append(appID).append("\'");

        return stringBuffer.toString();
    }

    public static void main(String[] args){
        Map<String,Object> map = new HashMap<>();
        map.put("appID","1");
        map.put("examPlanInfoID",66);
        map.put("examSubjectID",246);
//        getExamPapersBySomeWhere(map);
    }
}
